/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package tiendagui.internal;

import java.util.logging.Level;
import java.util.logging.Logger;

import javax.swing.JOptionPane;

import controller.Controller;

/**
 *
 * @author Jhonny
 */
public abstract class JInternalFrameImpl extends javax.swing.JInternalFrame{

    protected String            path;
    protected Controller        controller;
    protected Logger			logger;
    public JInternalFrameImpl() {
    	logger = Logger.getLogger(getClass().getName());
    }

    public void setPathFile(String path) {
        this.path = path;
    }

    public String getPath() {
        return path;
    }

    @Override
    public void setVisible(boolean aFlag) {
        if(aFlag){
            try {
                if(controller!=null){
                    controller.initComponentView();
                }
            } catch (Exception ex) {
            	JOptionPane.showMessageDialog(this, "Error al iniciar los datos de la ventana.");
                Logger.getLogger(JInternalFrameImpl.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        super.setVisible(aFlag);
    }

	

	
}
